ARG J_V=jdk8:471-d132slim
FROM registry.cn-hangzhou.aliyuncs.com/xiaoyilin/${J_V}
ARG M_V=3.9.11
ADD apache-maven-${M_V}.tar.gz /usr/local/
ENV MAVEN_HOME=/usr/local/apache-maven-${M_V}
ENV PATH=$MAVEN_HOME/bin:$PATH
CMD ["mvn","-v"]

# 使用阿里云MAVEN仓库
#  <mirror>
#    <id>nexus-aliyun</id>
#    <mirrorOf>central</mirrorOf>
#    <name>Nexus aliyun</name>
#    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
#  </mirror>
# tar -xvf apache-maven-3.9.11-bin.tar.gz
# apache-maven-3.9.11\conf\settings.xml
# tar -czvf apache-maven-3.9.11.tar.gz apache-maven-3.9.11/
# docker build --build-arg J_V=jdk8:471-d132slim -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/maven:3.9.11-java8 .
# docker build --build-arg J_V=java111:0.29-d132slim -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/maven:3.9.11-java11 .
# docker build --build-arg J_V=java17:0.17-d132slim -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/maven:3.9.11-java17 .
# docker build --build-arg J_V=java21:0.9-d132slim -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/maven:3.9.11-java21 .
# docker build --build-arg J_V=java25:0.1-d132slim -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/maven:3.9.11-java25 .
# docker build --build-arg J_V=graalvm:17.0.16 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/maven:3.9.11-graalvm17 .
# docker build --build-arg J_V=graalvm:21.0.9 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/maven:3.9.11-graalvm21 .
# docker build --build-arg J_V=graalvm:25.0.1 -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/maven:3.9.11-graalvm25 .

# docker run --rm -it registry.cn-hangzhou.aliyuncs.com/xiaoyilin/maven:3.9.11-java8 bash
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/maven:3.9.11-java8